package uuid

import (
	//"fmt"
	"github.com/zheng-ji/goSnowFlake"
)

var Worker *goSnowFlake.IdWorker

func InitWorker(workerId int64) error {
	var err error
	Worker, err = goSnowFlake.NewIdWorker(workerId)
	if err != nil {
		return err
	}
	return nil
}


func GetSnowFlakeId(iw *goSnowFlake.IdWorker) (int64, error) {
	if id, err := iw.NextId(); err != nil {
        return 0, err
    } else{
        return id, nil
    }	
}
